<template>
    <h3>欢迎使用题库管理系统</h3>
    <el-carousel :interval="3000" arrow="always" height="500px">
        <el-carousel-item v-for="item in data" :key="item">
            <el-image :src="item.url" fit="fill"></el-image>
        </el-carousel-item>
    </el-carousel>
</template>
<script setup>
import axios from 'axios';
import { ref, onMounted } from 'vue';

onMounted(() => {
    getHomeImage();
})

const data = ref([])



const getHomeImage = async () => {
    var res = await axios.get(`/knowledge/file/homeImage`);
    data.value = res.data.data;
}

</script>
<style>
.el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 800px;
    margin: 0;
}

.el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
}
</style>